# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  # Pick a unique cookie name to distinguish our session data from others'
  session :session_key => '_rplan_session_id'

  include AuthenticatedSystem

  before_filter :login_from_cookie

  before_filter do |c|
    if !c.session[:user].nil? && User.exists?(c.session[:user])
      User.current_user = User.find(c.session[:user])
    end
  end


end
